package com.zhuimeng.guavahomework.component;

import com.taobao.tair.impl.DefaultTairManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Arrays;

@Component
public class TairManager extends DefaultTairManager {
    @Value("${tair.servers}")
    private String servers;

    @Value("${tair.group.name}")
    private String cacheGroupName;

    @Override
    @PostConstruct
    public void init() {
        String[] arr = servers.split(",");
        configServerList = Arrays.asList(arr);
        this.groupName = cacheGroupName;
        super.init();
    }
}
